package com.xie.o2o.controller.superadmin;

import com.google.common.collect.Maps;
import com.xie.o2o.entity.Area;
import com.xie.o2o.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @create: xie
 */
@Controller
@RequestMapping("/superadmin")
public class AreaController {
    @Autowired
    private AreaService areaService;

    @RequestMapping(value = "/arealist", method = RequestMethod.GET)
    @ResponseBody
    public Map<String, List<Area>> getAreaList() {
        Map<String, List<Area>> map = Maps.newHashMap();
        List<Area> areaList = areaService.getAreaList();
        map.put("success", areaList);
        return map;
    }
}
